use "$replication\data\for_NSS.dta", clear


global Regress_terms "elec_m*   elec_p*   ROADxelec_m*   ROADxelec_p*"
global Rcontrols " i.ROAD#c.ln_pc01_pca_tot_p i.ROAD#c.ln_pc01_pca_tot_p_m i.ROAD#c.ln_dwelling_area i.ROAD#c.ln_dwelling_area_m i.ROAD#c.ln_land_possessed i.ROAD#c.ln_land_possessed_m i.ROAD#c.tdist_10 i.ROAD#c.tdist_10_m i.ROAD#c.tdist_50 i.ROAD#c.tdist_50_m i.ROAD#c.sc_share i.ROAD#c.sc_share_m i.ROAD#c.st_share i.ROAD#c.st_share_m i.ROAD#c.lit_share i.ROAD#c.lit_share_m i.ROAD#c.religion_code_* i.ROAD#c.social_group_code_* i.ROAD#c.land_possessed_code_code_*"


reghdfe  ln_HH_cons_rabi $Regress_terms   $Rcontrols , absorb(i.ROAD#i.year#i.d_id  i.ROAD#c.HH_size_*) cluster(FSU_wave)  poolsize(30)
estimates store main_regression

global coefplot_options "vertical  xtitle(" " "Years since connection")  yline(0)  omitted graphregion(color(white)) legend(rows(1))"
global Rcoefplot_terms "(main_regression, omitted keep(elec_m* elec_p*) label("Electricity") rename($rename_terms) mcolor(ebblue*1.5) ciopts(lcolor(ebblue*2) )) (main_regression, omitted keep(ROADxelec_m* ROADxelec_p*) label("Electricity and road") rename($rename_terms) mcolor(purple*1.5) ciopts(lcolor(purple*2) ))"

coefplot $Rcoefplot_terms , $coefplot_options 